package edu.sctu.wulixia.month4and5.day20150519;

/**
* Created by user05 on 2015/5/19.
*/
/*
创建一个类为TextOne,TextOne继承自TextMore
TexMain 里面有三个方法
*/

public class TestOne extends TestMore{
    private Teacher[] teachers;
    Student[] studentscore = new Student[teachers[0].student.length];
    Student[] studentscore1 = new Student[teachers[1].student.length];

    public TestOne(Teacher[] teacher){
        super(teacher);
    }

    /*
    getTercherInfo() 对老师编号排序后输出老师信息，
     */
    public void getTercherInfo(Teacher[] teacher){
        sotrNumber(teacher);
        System.out.println(teacher[0].number + "：" + teacher[1].number);
    }

    //getStudent(int code)处理学生成绩排序后的成绩大于coed的学生。

    public Student[] getStudent(int code,Student[] student){
        Teacher[] teachers = new Teacher[2];
        Student[] students = teachers[0].student;
        Student[] students1 = teachers[1].student;
        sortStudent(students);
        sortStudent(students1);

        for (int i = 0;i < students.length;i ++){
            if (students[i].score > code){
                studentscore[i] = students[i];
                System.out.println("学生成绩大于coed的有：" + studentscore1[i]);
            }
        }

        for (int i = 0;i < students1.length;i ++){
            if (students1[i].score > code){
                studentscore1[i] = students1[i];
                System.out.println("学生成绩大于coed的有：" + studentscore1[i]);
            }
        }
        return studentscore;
    }

/*
getCode()判断职称为教授的学生有哪些，并调用接口判断学生成绩大于code的学生，
判断调用getStudent(int code)方法。
 */

//    public Student[] getCode(){
//        Teacher teacher = pritCoded();
//        Student[] studentnumber = interFace.getInfo(teacher.student);
//        return studentnumber;
//    }

    Interface_Test interFace = new Interface_Test() {
        @Override
        public Student[] getInfo(Student[] student) {
            Student[] studentnumber = getStudent(60,student);
            return studentnumber;
        }
    };

    /*
    getCourse,此方法用于判断学生所选的共同课程
     */
}
